import store from "@/store"
export default setCookie

function setCookie() {
  // 匹配网易云cookie
  let pattern =
    /[a-zA-Z0-9_=]*[;] [a-zA-Z0-9=-]*; [a-zA-Z0-9=, :]*; Path=[/a-zA-Z0-9]*[;]/g
  // 获取cookie
  let userdata = store.state.PersonAccount.data
  let cookiematch = userdata.cookie
  let array = cookiematch.match(pattern)
  array.forEach((element) => {
    document.cookie = element
  })
}
